import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

export type ChargeOrderRealTimeInfoDocument = ChargeOrderRealTimeInfo & Document;

export class RealTimeInfo {
    timestamp: number;

    updateTime: number;

    consumeTime: number;

    power: number;

    voltage: number;

    current: number;

    consumeEnergy: number;

    temperature: number;
}


@Schema()
export class ChargeOrderRealTimeInfo extends Document<number> {
    @Prop(Number)
    _id : number;
    
    @Prop()
    lastData : RealTimeInfo;

    @Prop([RealTimeInfo])
    data : RealTimeInfo[];
}

export const ChargeOrderRealTimeInfoSchema = SchemaFactory.createForClass(ChargeOrderRealTimeInfo);